package com.lecyon.farm.common.constant;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Yao Zheng
 * @Date 2019/12/10 17:52
 */
public class FarmSysConstant {

    /**
     * 作业类型数组
     */
    public static final String[] SYS_JOB_TYPE = new String[]{"22", "23", "24", "25", "26", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "51", "53", "57"};

    public static final Map<String, String> SYS_JOB_TYPE_MAP = new HashMap<>();

    static {
        SYS_JOB_TYPE_MAP.put("23", "托管整地");
        SYS_JOB_TYPE_MAP.put("24", "托管播种");
        SYS_JOB_TYPE_MAP.put("25", "托管防治");
        SYS_JOB_TYPE_MAP.put("26", "托管收获");
        SYS_JOB_TYPE_MAP.put("31", "深松");
        SYS_JOB_TYPE_MAP.put("32", "水田");
        SYS_JOB_TYPE_MAP.put("33", "秸秆还田");
        SYS_JOB_TYPE_MAP.put("34", "免耕播种");
        SYS_JOB_TYPE_MAP.put("35", "植保");
        SYS_JOB_TYPE_MAP.put("36", "收获");
        SYS_JOB_TYPE_MAP.put("37", "插秧");
        SYS_JOB_TYPE_MAP.put("38", "水田施耕");
        SYS_JOB_TYPE_MAP.put("39", "水田整地");
        SYS_JOB_TYPE_MAP.put("3A", "打捆");
        SYS_JOB_TYPE_MAP.put("22", "托管");
        SYS_JOB_TYPE_MAP.put("10", "深耕");
        SYS_JOB_TYPE_MAP.put("11", "深旋");
        SYS_JOB_TYPE_MAP.put("51", "中耕作业");
        SYS_JOB_TYPE_MAP.put("53", "深翻");
        SYS_JOB_TYPE_MAP.put("57", "测深施肥");

    }

    /**
     * 系统角色name
     */
    public static final String SYS_MASTER_NAME = "systemMaster";
    public static final String ADMINISTRATOR_NAME = "administrator";
    public static final String USER_NAME = "user";
    public static final String SALES_NAME = "sales";
    public static final String PURCHASE_NAME = "purchase";
    public static final String WAREHOUSE_NAME = "warehouse";
    public static final String QA_NAME = "qualityAssurance";
    public static final String PE_NAME = "processEngineer";
    public static final String PMC_NAME = "productMaterialControl";
    public static final String PD_NAME = "productionDepartment";

    /**
     * 系统角色value
     */
    public static final String SYS_MASTER_VALUE = "超级管理员";
    public static final String ADMINISTRATOR_VALUE = "管理员";
    public static final String USER_VALUE = "普通用户";
    public static final String SALES_VALUE = "销售";
    public static final String PURCHASE_VALUE = "采购";
    public static final String WAREHOUSE_VALUE = "仓库管理员";
    public static final String QA_VALUE = "品质保障";
    public static final String PE_VALUE = "工艺工程";
    public static final String PMC_VALUE = "生产及物料控制";
    public static final String PD_VALUE = "生产部";


    public static final String REDIS_KEY_LOGIN_USER_TABLE = CommonConstant.SYSTEM_NAME + "_" + "login_user";
    public static final String REDIS_KEY_STATISTIC_TOTAL_WORK_DATA = CommonConstant.SYSTEM_NAME + "_" + "statistic_total_work_data";
    public static final String REDIS_KEY_SYS_AREA_TABLE = CommonConstant.SYSTEM_NAME + "_" + "js_sys_area";
    public static final String REDIS_KEY_SYS_OFFICE_TABLE = CommonConstant.SYSTEM_NAME + "_" + "js_sys_office";
    public static final String REDIS_KEY_NEED_SYNC_FM_CAR_TABLE = CommonConstant.SYSTEM_NAME + "_" + "fm_car";
    public static final String REDIS_KEY_NEED_SYNC_FM_CAR_MAP = CommonConstant.SYSTEM_NAME + "_" + "fm_car_map";
    public static final String REDIS_KEY_SYNC_CONFIG = CommonConstant.SYSTEM_NAME + "_" + "fm_sync_information";
    public static final String REDIS_KEY_ALREADY_RECORD_SYNC_INFO = CommonConstant.SYSTEM_NAME + "_" + "fm_already_sync_records";
    public static final String REDIS_KEY_SYNC_DATA_BUFFER_TABLE = CommonConstant.SYSTEM_NAME + "_" + "sync_data_buffer";
    public static final String REDIS_KEY_SYNC_DATA_VERIFICATION_TABLE = CommonConstant.SYSTEM_NAME + "_" + "sync_data_verification";
    public static final String REDIS_KEY_DAILY_DATA = CommonConstant.SYSTEM_NAME + "_" + "daily_data";
    public static final String REDIS_KEY_TOTAL_FM_WORK_BY_TYPE = CommonConstant.SYSTEM_NAME + "_" + "total_work_quantity_by_type";
    public static final String REDIS_KEY_TOTAL_FM_WORK_BY_WEEK = CommonConstant.SYSTEM_NAME + "_" + "total_work_quantity_by_week";
    public static final String REDIS_KEY_TOTAL_FM_WORK_BY_AREA = CommonConstant.SYSTEM_NAME + "_" + "total_work_quantity_by_area";
    public static final String REDIS_KEY_EQUIPMENT_DISTRIBUTION = CommonConstant.SYSTEM_NAME + "_" + "equipment_distribution";
    public static final String REDIS_KEY_EQUIPMENT_GPS_INFORMATION = CommonConstant.SYSTEM_NAME + "_" + "equipment_last_gps_distribution";
    public static final String REDIS_KEY_FM_WORK_DETAIL_COUNT_YESTERDAY = CommonConstant.SYSTEM_NAME + "_" + "fm_work_detail_count_yesterday";
    public static final String REDIS_KEY_FM_WORK_TOTAL_YESTERDAY = CommonConstant.SYSTEM_NAME + "_" + "total_fm_work_yesterday";
    public static final String REDIS_KEY_ACTIVE_DEVICE_COUNT_YESTERDAY = CommonConstant.SYSTEM_NAME + "_" + "total_active_device_count_yesterday";
    public static final String REDIS_KEY_TOTAL_WORK_QUANTITY_BY_AREA_AND_TYPE = CommonConstant.SYSTEM_NAME + "_" + "total_work_quantity_by_are_and_type";
    public static final String REDIS_KEY_JS_SYS_OFFICE = CommonConstant.SYSTEM_NAME + "_" + "js_sys_office";
    public static final String REDIS_KEY_JS_SYS_OFFICE_ALL_DATA = CommonConstant.SYSTEM_NAME + "_" + "js_sys_office_all_data";
    public static final String REDIS_KEY_STATISTIC_COOPERATION = CommonConstant.SYSTEM_NAME + "_" + "statistic_fm_coop_info";
    public static final String REDIS_KEY_STATISTIC_TOTAL_WORK_QUANTITY = CommonConstant.SYSTEM_NAME + "_" + "statistic_work_quantity_info";

    /**
     * 定时任务执行频率
     */
    public static final int SCHEDULE_FIX_RATE = 1000 * 60 * 30;
    public static final int SCHEDULE_FIX_RATE_PER_DAY = 1000 * 60 * 60 * 24;

    /**
     * 位置信息推送时间间隔 5分钟
     */
    public static final int MACHINE_TRAILS_INTERVAL = 5;

    /**
     * 绿谷平台返回码
     */
    public static final Integer LVGU_RETURN_CODE_SUCCESS = 0;
    public static final Integer LVGU_RETURN_CODE_LOGIN_INFO_ERROR_ = 100;
    public static final Integer LVGU_RETURN_CODE_IP_ERROR = 101;
    public static final Integer LVGU_RETURN_CODE_FACTORY_ID_ERROR = 102;
    public static final Integer LVGU_RETURN_CODE_NECESSARY_MISS = 200;
    public static final Integer LVGU_RETURN_CODE_DATA_FORMAT_ERROR = 201;
    public static final Integer LVGU_RETURN_CODE_JSON_ERROR = 300;
    public static final Integer LVGU_RETURN_CODE_URL_ERROR = 404;
    public static final Integer LVGU_RETURN_CODE_SERVICE_ERROR = 500;
    public static final Integer LVGU_RETURN_CODE_API_BUSY = 600;
    public static final Integer LVGU_RETURN_CODE_UNKNOWN = 999;
    public static final String LVGU_DEFAULT_COMMAND_ID = "34";
    public static final String LVGU_TARGET_PLATFORM_NAME = "lvgu";

    public static final BigDecimal GPS_INVALID_DATA = new BigDecimal("0");


    /**
     * 阿里云对象存储相关
     * <p>
     * ALI_OSS_PICTURE_STYLE 图片处理样式
     */
    public static final String ALI_OSS_PICTURE_STYLE = "image/auto-orient,1/quality,q_90";

    /**
     * 消息队列数据源配置
     */
    public static final String DEFAULT_MESSAGE_QUEUING_SERVER = "39.107.152.122";
}
